package io;

import java.io.*;

public class TestInputStream {
    public static void main(String[] args) {
        try (FileInputStream file = new FileInputStream("d:/test.txt")){
            int tmp;
            byte[] bytes = new byte[10];
            while((tmp = file.read(bytes)) != -1){
                System.out.print(new String(bytes, 0, tmp));
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
